<template>
  <div>
    <a-table :columns="columns" :data="userList">
      <template #operation>
        <a-button class="mr-[20px]">编辑</a-button>
        <a-button>删除</a-button>
      </template>
    </a-table>
    <!-- <EditUser v-model:visible="editvisible" v-if="editvisible"></EditUser> -->
  </div>
</template>

<script setup lang="ts">
import { getUserList } from "@/api/user";
import { ref } from "vue";
// import EditUser from "../userview/"
const userList = ref([]);
const editvisible = ref(false);
const columns = [
  {
    title: "用户名",
    dataIndex: "name",
  },
  {
    title: "密码",
    dataIndex: "password",
  },
  {
    title: "金钱",
    dataIndex: "money",
  },
  {
    title: "操作",
    dataIndex: "operation",
    slotName: "operation",
  },
];
const pageNum = ref(1);
const pageSize = ref(20);
const getList = async () => {
  try {
    let res = await getUserList();
    if (res.code == 200) {
      console.log(res);
      userList.value = res.data;
    }
  } catch (error) {
    console.error(error);
  }
};
getList();
</script>

<style lang="less" scoped></style>
